import { Routes, Route, Navigate } from "react-router-dom";

import Homepage from "../view/Homepage/Homepage";
import News from "../view/Homepage/News/News";
import Newnum from "../view/Homepage/Newnum/Newnum";
import Earnings from "../view/Homepage/Earnings/Earnings";
import Financial from "../view/Financial/Financial";
import List from "../view/Goods/List/List";
import Ruku from "../view/Goods/Ruku/Ruku";
import Type from "../view/Goods/Type/Type";
import Order from "../view/Order/Order";
import Orderdat from "../view/orderdat/Orderdat";
import Xiangqing from "../view/Goods/List/Xiangqing";
import Aftersales from "../view/Aftersales/Aftersales";
import AfterDat from "../view/AfterDat/AfterDat";
import Custormerservice from "../view/CustomerService/CustormServer";
import CreateLevel from "../view/CustomerService/CreateLevel/CreateLevel";
import CustomerControl from "../view/CustomerService/CustomerControl";
import User from "../view/User/User";
import MemberLevel from "../view/User/MemberLevel";
import CreateMemberLevel from "../view/User/CreateMemberLevel/CreateMemberLevel";
import CreateMemberTag from "../view/User/CreateMemberTag/CreateMemberTag";
import MemberTag from "../view/User/MemberTag";
import Diy from "../view/DIY/DIY";

function MyRouter() {
  return (
    <Routes>
      <Route path="/home">
        <Route path="/home" element={<Navigate to="/home/homepage" />} />
        <Route path="/home/homepage" element={<Homepage />}>
          <Route index element={<News />} />
          <Route path="/home/homepage/newdata" element={<Newnum />} />
          <Route path="/home/homepage/earnings" element={<Earnings />} />
        </Route>
        <Route path="/home/financial" element={<Financial />} />
        <Route path="/home/list" element={<List />} />
        <Route path="/home/list/xiangqing" element={<Xiangqing />} />
        <Route path="/home/ruku" element={<Ruku />} />
        <Route path="/home/type" element={<Type />} />
        <Route path="/home/order" element={<Order />} />
        <Route path="/home/order/orderdat" element={<Orderdat />} />
        <Route path="/home/Aftersales" element={<Aftersales />} />
        <Route path="/home/Aftersales/AfterDat" element={<AfterDat />} />
        <Route path="/home/custormerservice" element={<Custormerservice />} />
        <Route path="/home/CustomerControl" element={<CustomerControl />} />
        <Route path="/home/user" element={<User />} />
        <Route path="/home/MemberLevel" element={<MemberLevel />} />
        <Route path="/home/MemberTag" element={<MemberTag />} />
        <Route path="/home/diy" element={<Diy />} />
        <Route
          path="/home/custormerservice/createlevel"
          element={<CreateLevel />}
        />
        <Route
          path="/home/CreateMemberLevel/CreateMemberLevel"
          element={<CreateMemberLevel />}
        ></Route>
        <Route
          path="/home/CreateMemberTag/CreateMemberTag"
          element={<CreateMemberTag />}
        ></Route>
      </Route>
    </Routes>
  );
}
export default MyRouter;
